package huangjinkuanggong;

import java.awt.*;

public class BackGround {
    //总分
     static int count = 0;
    Image background = Toolkit.getDefaultToolkit().getImage
            ("C:\\Users\\杨翔压民\\Desktop\\image\\background.jpg");

    //关卡数
    static int level = 1;

    //目标得分
    int goal = level * 15;

    //总分
    static int getCount = 0;

    //开始时间
    long startTime;

    //结束时间
    long endTime;





    void paintSelf(Graphics g){
        g.drawImage(background,0,0,null);
//        g.drawImage(background2,0,328,null);
        //g.drawImage(background3,0,0,null);
        g.setColor(Color.BLACK);

        //绘制关卡数
        drawWord(g,20,Color.black,"第"+level+"关",30,60);

        //目标积分
        drawWord(g,30,Color.black,"目标"+goal+"关",30,110);
    }

    //绘制字符串
    public static void drawWord(Graphics g,int size,
                                Color color,String str,int x ,int y){
        g.setColor(color);
        g.setFont(new Font("仿宋",Font.BOLD,30));
        g.drawString("积分"+ count,30,150);
        g.drawString(str,x,y);

    }

}
